﻿var keditor;
var items = ['source', '|', 'undo', 'redo', '|', 'preview', 'code', 'cut', 'copy', 'paste',
       'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
       'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent',
       'subscript', 'superscript', 'clearhtml', 'quickformat', 'selectall', '|',
       'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
       'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|',
       'image', 'multiimage', 'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons',
       'baidumap', 'pagebreak', 'anchor', 'link', 'unlink', 'fullscreen'];
var paras = {
    height: '100%',
    resizeType: 1,
    allowPreviewEmoticons: false,
    allowImageUpload: true,
    themeType: 'simple',
    shadowMode: true,
    items: items,
    autoHeightMode: true,
    afterChange: function ()//输入文字事件
    {
        var autoheight = KindEditor.IE ? this.edit.doc.body.scrollHeight : this.edit.doc.body.offsetHeight; //判断是否是IE，并获取内容高度。
        this.edit.setHeight(autoheight);
    }, //设置高度
    afterBlur: function () { this.sync(); },
    afterCreate: function () { this.loadPlugin('autoheight'); },
};
var kerbasePath = '/ker/';
var kerjsPath = '/ker/kindeditor-min.js';
$.getScript(kerjsPath, function () { KindEditor.basePath = kerbasePath; keditor = KindEditor.create('textarea[name="Content"]', paras); });
// $('input[name=editorCreate]').click(function () { $.getScript(kerjsPath, function () { KindEditor.basePath = kerbasePath; KindEditor.create('textarea[name="Content"]', paras); }); });
// $('input[name=editorRemove]').click(function () { KindEditor.remove('textarea[name="Content"]', paras); });
